import React, { useState, useEffect } from "react";
// import { useCookie } from "react-use";
import useCookie from "../../hooks/customs/useCookie";

const TestUseCookies = () => {
    const [value, updateCookie, deleteCookie] = useCookie("abin")
    useEffect(() => {
        deleteCookie();
    }, []);

    const updateCookieHandler = () => {
        updateCookie("666");
    };

    return (
        <div>
            <p>cookie 值: {value}</p>
            <button onClick={updateCookieHandler}>更新 Cookie</button>
            <br />
            <button onClick={deleteCookie}>删除 Cookie</button>
        </div>
    );
}

export default TestUseCookies
